home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 16262 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.8 KB

  1. Path: solon.com!not-for-mail
  2. From: seebs@solutions.solon.com (Peter Seebach)
  3. Newsgroups: comp.lang.ada,comp.lang.c,comp.lang.c++,comp.edu
  4. Subject: Re: ANSI C and POSIX (was Re: C/C++ knocks the crap out of Ada)
  5. Date: 9 Apr 1996 22:59:05 -0500
  6. Organization: Usenet Fact Police (Undercover)
  7. Message-ID: <4kfbm9$ea2@solutions.solon.com>
  8. References: <JSA.96Feb16135027@organon.com> <dewar.829048603@schonberg> <4kets3$ic0@news-s01.ny.us.ibm.net> <dewar.829101156@schonberg>
  9. Reply-To: seebs@solon.com
  10. NNTP-Posting-Host: solutions.solon.com
  11.  
  12. In article <dewar.829101156@schonberg>, Robert Dewar <dewar@cs.nyu.edu> wrote:
  13. >No, that's confused. First of all, the clear specifications of most
  14. >specific systems, e.g. SunOS, GUARANTEE *not* to give a sigsegv for
  15. >the call in question. Linux may or may nt give a SIGSEGV depending
  16. >on the luck of the draw (where the buffer is in memory). 
  17.  
  18. I suspect what you're seeing is an obvious bug in their specs.  As
  19. written, the spec on at least one system also guarantees not to give
  20. a fault for
  21.     char buf;
  22.     read(fd, &buf, 1000);
  23. even if there are 1000 bytes available, because the check is only specified
  24. for whether the pointer given points to a valid object.
  25.  
  26. >Of course writing portable code requires careful consideration
  27. >of various possibilities, and failure to be careful certainly
  28. >results in portability problems. But it is clear that if the
  29. >spec for read had been clearer, this bug would NOT have been
  30. >present in the first place!
  31.  
  32. I doubt it.  I would bet that whoever wrote it did not give adequate
  33. consideration to it, and did not check the spec in any detail.
  34.  
  35. -s
  36. -- 
  37. Peter Seebach - seebs@solon.com - Copyright 1996 Peter Seebach.
  38. C/Unix wizard -- C/Unix questions? Send mail for help.  No, really!
  39. FUCK the communications decency act.  Goddamned government.  [literally.]
  40. The *other* C FAQ - http://www.solon.com/~seebs/c/c-iaq.html
  41.